﻿using KinonekoSoftware.CodariaDB.Documents.Shenanigans;
using KinonekoSoftware.Extensions.Collections;

namespace KinonekoSoftware.CodariaDB.IO
{
    public class TalkingEmojiResourceFinder : ResourceFinder
    {
        public override void GetResources(ICollection<Resource> collection, IRepository repository)
        {
            var database = repository.Get<Emoji>(CollectionNames.TalkingDB_Emoji);
            collection.AddMany(database.FindAll()
                                       .Select(x => new Resource
                                        {
                                            ImageID = x.Source,
                                            Type    = ResourceType.Emoji,
                                            Usage   = true,
                                        }));
        }
    }
}